using System;
using Randomize.Core.Generators;

namespace Randomize.Core.Descriptors
{
    public abstract class GenerationDescriptor<TGenerate, TDescriptor> : IGenerationDescriptor<TGenerate, TDescriptor> 
        where TDescriptor : class, IGenerationDescriptor<TGenerate, TDescriptor>
    {
        protected TGenerate[] Pool { get; set; }

        public abstract IGenerator<TGenerate> CreateGenerator(Random random);

        public virtual TDescriptor WithPool(TGenerate[] pool)
        {
            this.Pool = pool;
            return this as TDescriptor;
        }
    }
}